package 蓝桥真题.javaB组国赛真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class 左移右移 {
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static final int N=(int)2e5+10;
    static int n,m;
    static Pair a[]=new Pair[N];
    static class Pair{
        int x,idx;
        Pair(int x,int idx){
            this.x=x;
            this.idx=idx;
        }
    }
    public static void main(String[] ss) throws IOException {
        ss=br.readLine().split(" ");
        n=Integer.parseInt(ss[0]);m=Integer.parseInt(ss[1]);
        int st=N,ed=st+n-1;
        int t=1;
        for(int i=st;i<=ed;i++,t++){
            a[t] = new Pair(t,i);
        }
        while(m-->0){
            ss=br.readLine().split(" ");
            int x=Integer.parseInt(ss[1]);
            if(ss[0].equals("L")) a[x].idx=--st;
            else a[x].idx=++ed;
        }
        Arrays.sort(a,1,n+1,(o1, o2) -> o1.idx-o2.idx);
        for(int i=1;i<=n;i++)
            System.out.print(a[i].x+" ");
    }
}
/*
5 3
L 3
L 2
R 4
* */